import Stack from "./stack";

export default function Dec2bin(dec){
	// 定义变量
	let stack = new Stack();
	let remainder;

	while (dec > 0){
		remainder = dec % 2;
		dec = Math.floor(dec / 2);
		stack.push(remainder);
	}

	let binayriString = "";
	while (!stack.isEmpty()){
		binayriString += stack.pop();
	}
	return binayriString;
}
